﻿@model IEnumerable<sushi.Models.Post>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            title
        </th>
        <th>
            Introduction
        </th>
        <th>
            Body
        </th>
        <th>
            Creation
        </th>
        <th>
            LastModification
        </th>
        <th>
            Author
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Introduction)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Body)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Creation)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LastModification)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Author.Name)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.PostId }) |
            @Html.ActionLink("Details", "Details", new { id=item.PostId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.PostId })
        </td>
    </tr>
}

</table>
